package com.lagou.product.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lagou.product.pojo.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;

import javax.persistence.GeneratedValue;


public interface ProductMapper extends BaseMapper<Product> {


    @Insert("INSERT INTO product (name, price, flag, goods_desc, images, goods_stock, goods_type) VALUES (#{name}, #{price}, #{flag}, #{goodsDesc}, #{images}, #{goodsStock}, #{goodsType})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    Long insertProduct(Product product);
}
